<?php

declare(strict_types=1);

namespace ImiApp\ApiServer\Api\Model\Base;

use Imi\Config\Annotation\ConfigValue;
use Imi\Model\Annotation\Column;
use Imi\Model\Annotation\DDL;
use Imi\Model\Annotation\Entity;
use Imi\Model\Annotation\Table;
use ImiApp\ImiServer\AbstractModel as Model;

/**
 * 附件表 基类.
 *
 * @Entity(camel=false, bean=true, incrUpdate=false)
 * @Table(name=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\Attachment.name", default="fa_attachment"), usePrefix=false, id={"id"}, dbPoolName=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\Attachment.poolName"))
 * @DDL(sql="CREATE TABLE `fa_attachment` (
  `id` int(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `category` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '类别',
  `admin_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '管理员ID',
  `store_id` int(10) DEFAULT NULL COMMENT '店铺ID',
  `user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '会员ID',
  `url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '物理路径',
  `imagewidth` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '宽度',
  `imageheight` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '高度',
  `imagetype` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '图片类型',
  `imageframes` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '图片帧数',
  `filename` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '文件名称',
  `filesize` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '文件大小',
  `mimetype` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT 'mime类型',
  `extparam` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '透传数据',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建日期',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  `uploadtime` bigint(16) DEFAULT NULL COMMENT '上传时间',
  `storage` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'local' COMMENT '存储位置',
  `sha1` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '文件 sha1编码',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='附件表'", decode="")
 *
 * @property int|null $id ID
 * @property string|null $category 类别
 * @property int|null $adminId 管理员ID
 * @property int|null $storeId 店铺ID
 * @property int|null $userId 会员ID
 * @property string|null $url 物理路径
 * @property string|null $imagewidth 宽度
 * @property string|null $imageheight 高度
 * @property string|null $imagetype 图片类型
 * @property int|null $imageframes 图片帧数
 * @property string|null $filename 文件名称
 * @property int|null $filesize 文件大小
 * @property string|null $mimetype mime类型
 * @property string|null $extparam 透传数据
 * @property int|null $createtime 创建日期
 * @property int|null $updatetime 更新时间
 * @property int|null $uploadtime 上传时间
 * @property string|null $storage 存储位置
 * @property string|null $sha1 文件 sha1编码
 */
abstract class AttachmentBase extends Model
{
    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEY = 'id';

    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEYS = ["id"];

    /**
     * ID.
     * id
     * @Column(name="id", type="int", length=20, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=true, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $id = NULL;

    /**
     * 获取 id - ID.
     *
     * @return int|null
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * 赋值 id - ID.
     * @param int|null $id id
     * @return static
     */
    public function setId($id)
    {
        $this->id = null === $id ? null : (int)$id;
        return $this;
    }

    /**
     * 类别.
     * category
     * @Column(name="category", type="varchar", length=50, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $category = '';

    /**
     * 获取 category - 类别.
     *
     * @return string|null
     */
    public function getCategory(): ?string
    {
        return $this->category;
    }

    /**
     * 赋值 category - 类别.
     * @param string|null $category category
     * @return static
     */
    public function setCategory($category)
    {
        $this->category = null === $category ? null : (string)$category;
        return $this;
    }

    /**
     * 管理员ID.
     * admin_id
     * @Column(name="admin_id", type="int", length=10, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $adminId = 0;

    /**
     * 获取 adminId - 管理员ID.
     *
     * @return int|null
     */
    public function getAdminId(): ?int
    {
        return $this->adminId;
    }

    /**
     * 赋值 adminId - 管理员ID.
     * @param int|null $adminId admin_id
     * @return static
     */
    public function setAdminId($adminId)
    {
        $this->adminId = null === $adminId ? null : (int)$adminId;
        return $this;
    }

    /**
     * 店铺ID.
     * store_id
     * @Column(name="store_id", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $storeId = NULL;

    /**
     * 获取 storeId - 店铺ID.
     *
     * @return int|null
     */
    public function getStoreId(): ?int
    {
        return $this->storeId;
    }

    /**
     * 赋值 storeId - 店铺ID.
     * @param int|null $storeId store_id
     * @return static
     */
    public function setStoreId($storeId)
    {
        $this->storeId = null === $storeId ? null : (int)$storeId;
        return $this;
    }

    /**
     * 会员ID.
     * user_id
     * @Column(name="user_id", type="int", length=10, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $userId = 0;

    /**
     * 获取 userId - 会员ID.
     *
     * @return int|null
     */
    public function getUserId(): ?int
    {
        return $this->userId;
    }

    /**
     * 赋值 userId - 会员ID.
     * @param int|null $userId user_id
     * @return static
     */
    public function setUserId($userId)
    {
        $this->userId = null === $userId ? null : (int)$userId;
        return $this;
    }

    /**
     * 物理路径.
     * url
     * @Column(name="url", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $url = '';

    /**
     * 获取 url - 物理路径.
     *
     * @return string|null
     */
    public function getUrl(): ?string
    {
        return $this->url;
    }

    /**
     * 赋值 url - 物理路径.
     * @param string|null $url url
     * @return static
     */
    public function setUrl($url)
    {
        $this->url = null === $url ? null : (string)$url;
        return $this;
    }

    /**
     * 宽度.
     * imagewidth
     * @Column(name="imagewidth", type="varchar", length=30, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $imagewidth = '';

    /**
     * 获取 imagewidth - 宽度.
     *
     * @return string|null
     */
    public function getImagewidth(): ?string
    {
        return $this->imagewidth;
    }

    /**
     * 赋值 imagewidth - 宽度.
     * @param string|null $imagewidth imagewidth
     * @return static
     */
    public function setImagewidth($imagewidth)
    {
        $this->imagewidth = null === $imagewidth ? null : (string)$imagewidth;
        return $this;
    }

    /**
     * 高度.
     * imageheight
     * @Column(name="imageheight", type="varchar", length=30, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $imageheight = '';

    /**
     * 获取 imageheight - 高度.
     *
     * @return string|null
     */
    public function getImageheight(): ?string
    {
        return $this->imageheight;
    }

    /**
     * 赋值 imageheight - 高度.
     * @param string|null $imageheight imageheight
     * @return static
     */
    public function setImageheight($imageheight)
    {
        $this->imageheight = null === $imageheight ? null : (string)$imageheight;
        return $this;
    }

    /**
     * 图片类型.
     * imagetype
     * @Column(name="imagetype", type="varchar", length=30, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $imagetype = '';

    /**
     * 获取 imagetype - 图片类型.
     *
     * @return string|null
     */
    public function getImagetype(): ?string
    {
        return $this->imagetype;
    }

    /**
     * 赋值 imagetype - 图片类型.
     * @param string|null $imagetype imagetype
     * @return static
     */
    public function setImagetype($imagetype)
    {
        $this->imagetype = null === $imagetype ? null : (string)$imagetype;
        return $this;
    }

    /**
     * 图片帧数.
     * imageframes
     * @Column(name="imageframes", type="int", length=10, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $imageframes = 0;

    /**
     * 获取 imageframes - 图片帧数.
     *
     * @return int|null
     */
    public function getImageframes(): ?int
    {
        return $this->imageframes;
    }

    /**
     * 赋值 imageframes - 图片帧数.
     * @param int|null $imageframes imageframes
     * @return static
     */
    public function setImageframes($imageframes)
    {
        $this->imageframes = null === $imageframes ? null : (int)$imageframes;
        return $this;
    }

    /**
     * 文件名称.
     * filename
     * @Column(name="filename", type="varchar", length=100, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $filename = '';

    /**
     * 获取 filename - 文件名称.
     *
     * @return string|null
     */
    public function getFilename(): ?string
    {
        return $this->filename;
    }

    /**
     * 赋值 filename - 文件名称.
     * @param string|null $filename filename
     * @return static
     */
    public function setFilename($filename)
    {
        $this->filename = null === $filename ? null : (string)$filename;
        return $this;
    }

    /**
     * 文件大小.
     * filesize
     * @Column(name="filesize", type="int", length=10, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $filesize = 0;

    /**
     * 获取 filesize - 文件大小.
     *
     * @return int|null
     */
    public function getFilesize(): ?int
    {
        return $this->filesize;
    }

    /**
     * 赋值 filesize - 文件大小.
     * @param int|null $filesize filesize
     * @return static
     */
    public function setFilesize($filesize)
    {
        $this->filesize = null === $filesize ? null : (int)$filesize;
        return $this;
    }

    /**
     * mime类型.
     * mimetype
     * @Column(name="mimetype", type="varchar", length=100, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $mimetype = '';

    /**
     * 获取 mimetype - mime类型.
     *
     * @return string|null
     */
    public function getMimetype(): ?string
    {
        return $this->mimetype;
    }

    /**
     * 赋值 mimetype - mime类型.
     * @param string|null $mimetype mimetype
     * @return static
     */
    public function setMimetype($mimetype)
    {
        $this->mimetype = null === $mimetype ? null : (string)$mimetype;
        return $this;
    }

    /**
     * 透传数据.
     * extparam
     * @Column(name="extparam", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $extparam = '';

    /**
     * 获取 extparam - 透传数据.
     *
     * @return string|null
     */
    public function getExtparam(): ?string
    {
        return $this->extparam;
    }

    /**
     * 赋值 extparam - 透传数据.
     * @param string|null $extparam extparam
     * @return static
     */
    public function setExtparam($extparam)
    {
        $this->extparam = null === $extparam ? null : (string)$extparam;
        return $this;
    }

    /**
     * 创建日期.
     * createtime
     * @Column(name="createtime", type="bigint", length=16, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $createtime = NULL;

    /**
     * 获取 createtime - 创建日期.
     *
     * @return int|null
     */
    public function getCreatetime(): ?int
    {
        return $this->createtime;
    }

    /**
     * 赋值 createtime - 创建日期.
     * @param int|null $createtime createtime
     * @return static
     */
    public function setCreatetime($createtime)
    {
        $this->createtime = null === $createtime ? null : (int)$createtime;
        return $this;
    }

    /**
     * 更新时间.
     * updatetime
     * @Column(name="updatetime", type="bigint", length=16, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $updatetime = NULL;

    /**
     * 获取 updatetime - 更新时间.
     *
     * @return int|null
     */
    public function getUpdatetime(): ?int
    {
        return $this->updatetime;
    }

    /**
     * 赋值 updatetime - 更新时间.
     * @param int|null $updatetime updatetime
     * @return static
     */
    public function setUpdatetime($updatetime)
    {
        $this->updatetime = null === $updatetime ? null : (int)$updatetime;
        return $this;
    }

    /**
     * 上传时间.
     * uploadtime
     * @Column(name="uploadtime", type="bigint", length=16, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $uploadtime = NULL;

    /**
     * 获取 uploadtime - 上传时间.
     *
     * @return int|null
     */
    public function getUploadtime(): ?int
    {
        return $this->uploadtime;
    }

    /**
     * 赋值 uploadtime - 上传时间.
     * @param int|null $uploadtime uploadtime
     * @return static
     */
    public function setUploadtime($uploadtime)
    {
        $this->uploadtime = null === $uploadtime ? null : (int)$uploadtime;
        return $this;
    }

    /**
     * 存储位置.
     * storage
     * @Column(name="storage", type="varchar", length=100, accuracy=0, nullable=false, default="local", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $storage = 'local';

    /**
     * 获取 storage - 存储位置.
     *
     * @return string|null
     */
    public function getStorage(): ?string
    {
        return $this->storage;
    }

    /**
     * 赋值 storage - 存储位置.
     * @param string|null $storage storage
     * @return static
     */
    public function setStorage($storage)
    {
        $this->storage = null === $storage ? null : (string)$storage;
        return $this;
    }

    /**
     * 文件 sha1编码.
     * sha1
     * @Column(name="sha1", type="varchar", length=40, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $sha1 = '';

    /**
     * 获取 sha1 - 文件 sha1编码.
     *
     * @return string|null
     */
    public function getSha1(): ?string
    {
        return $this->sha1;
    }

    /**
     * 赋值 sha1 - 文件 sha1编码.
     * @param string|null $sha1 sha1
     * @return static
     */
    public function setSha1($sha1)
    {
        $this->sha1 = null === $sha1 ? null : (string)$sha1;
        return $this;
    }

}
